﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace FrogEngine
{
	/// <summary>
	/// Class for easily spawing particles for a given particle system with custom spawn logic...
	/// Note that rendering is still taken care of by the ParticleSystem.  All that needs be done is to 
	/// add the particles using your custom logic in the Update method.
	/// </summary>
	/// <typeparam name="T"></typeparam>
	public abstract class ParticleEmitter<T> : GameEntityBase3D, ILogical 
		where T : IParticleSystem
	{
		public ParticleEmitter(IEngine engine)
			: base(engine)
		{
			this.system = engine.GetService<ParticleService>().GetParticleSystem<T>();
		}

		protected T system;
		public T ParticleSystem { get { return system; } }

		public virtual void Update(GameTime gameTime) { }
	}
}
